-
Notifications
You must be signed in to change notification settings - Fork 60
feat: added support for AsyncAPI v3 #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Also cleaned up the spec to make it very clear that step-object can be oneOf openapi-step-object or asyncapi-step-object or workflow-step-object For AsyncAPI we really need support for timeout, fork and join. However, these are also useful for OpenAPI so added it at the base step object. For OpenAPI we need at least one successCriteria but for AsyncAPI it can be optional.
|
Let's have you join Nick, Mike and myself next week and the next few weeks for some follow up on how this works. We started meeting to discuss the best approach forward as well. As this would fundamentally alter the spec we'll definitely need a bit of time to go through what you have here and what we are looking in to.. see what might overlap, etc. Shoot me a msg on slack with your email so I can add you to our conversations there. |
|
Here is a simple example just for your reference. arazzo: "1.0.1"
info:
title: "Workflow for placing an Order"
version: "1.0.0"
sourceDescriptions:
- name: "OrderApi"
url: "./openapi/order.yaml"
type: "openapi"
- name: "AsyncOrderApi"
url: "./asyncapi/order.yaml"
type: "asyncapi"
workflows:
- workflowId: "PlaceOrder"
inputs:
required:
- "CreateOrder"
type: "object"
properties:
CreateOrder:
required:
- "orderRequestId"
- "productId"
- "quantity"
type: "object"
properties:
orderRequestId:
type: "string"
productId:
type: "integer"
quantity:
type: "integer"
steps:
- stepId: "CreateOrder"
operationId: "$sourceDescriptions.AsyncOrderApi.PlaceOrder"
stepType: "asyncapi"
action: "send"
parameters:
- name: "orderRequestId"
in: "header"
value: "$inputs.CreateOrder.orderRequestId"
requestBody:
payload:
productId: "$inputs.CreateOrder.productId"
quantity: "$inputs.CreateOrder.quantity"
outputs:
orderRequestId: "$message.header.orderRequestId"
- stepId: "ConfirmOrder"
operationId: "$sourceDescriptions.AsyncOrderApi.PlaceOrder"
stepType: "asyncapi"
action: "receive"
correlationId: "$steps.CreateOrder.outputs.orderRequestId"
timeout: 6000
outputs:
orderId: "$message.body.orderId"
- stepId: "GetOrderDetails"
operationId: "$sourceDescriptions.OrderApi.getOrder"
parameters:
- name: "orderId"
in: "path"
value: "$steps.ConfirmOrder.outputs.orderId"
successCriteria:
- condition: "$statusCode == 200"
components: {} |
|
As discussed, here is an example with fork and join arazzo: "1.0.1"
info:
title: "Workflow for placing an Order"
version: "1.0.0"
sourceDescriptions:
- name: "OrderApi"
url: "./openapi/order.yaml"
type: "openapi"
- name: "AsyncOrderApi"
url: "./asyncapi/order.yaml"
type: "asyncapi"
workflows:
- workflowId: "PlaceOrder"
inputs:
required:
- "CreateOrder"
type: "object"
properties:
CreateOrder:
required:
- "orderRequestId"
- "productId"
- "quantity"
type: "object"
properties:
orderRequestId:
type: "string"
productId:
type: "integer"
quantity:
type: "integer"
steps:
- stepType: "asyncapi"
stepId: "ConfirmOrder"
operationId: "$sourceDescriptions.AsyncOrderApi.PlaceOrder"
action: "receive"
correlationId: "$inputs.CreateOrder.orderRequestId"
fork: true # Converts ConfirmOrder to a Non Blocking Step
timeout: 6000
outputs:
orderId: "$message.body.orderId"
- stepType: "asyncapi"
stepId: "CreateOrder"
operationId: "$sourceDescriptions.AsyncOrderApi.PlaceOrder"
action: "send"
parameters:
- name: "orderRequestId"
in: "header"
value: "$inputs.CreateOrder.orderRequestId"
requestBody:
payload:
productId: "$inputs.CreateOrder.productId"
quantity: "$inputs.CreateOrder.quantity"
- stepId: "GetOrderDetails"
operationId: "$sourceDescriptions.OrderApi.getOrder"
join: # Waits for ConfirmOrder to complete or timeout
- ConfirmOrder # Can also be 'true' to join/wait all
parameters:
- name: "orderId"
in: "path"
value: "$steps.ConfirmOrder.outputs.orderId"
successCriteria:
- condition: "$statusCode == 200"
components: {} |
|
Thanks @nashjain - I will try to propose changes to the specification based on the examples later this week. There will no doubt be a few finer grained points that we'll need to discuss |
chore(infra): archive schema and update actions, scripts etc.
…repo main: Create publishing PRs in new site repo
|
Taking the above examples into consideration here's a proposal outlining the specification changes to support AsyncAPI in v1.1.0. I've also provided an updated example which complies to the this proposal below. If we're in general agreement, I'll update this PR to reflect the proposal. Summary of the specification changes to add AsyncAPI support (not exhaustive)Source Description Object
|
|
Thanks @frankkilcommins The proposal mostly looks good to me. I just need sometime to think through a couple of items. I'm currently in Australia. Next week, once I'm back we could jump on a call to discuss and close it. |
|
@nashjain We discussed a bit about the removal of fork: true and kind: async implicitly indicates a fork, so removing that and then using dependsOn instead of join since we have dependsOn in the spec already elsewhere. Also the nature of a "fire and forget" (dont need response) vs "fire and wait for a response" which basically assumes if a dependsOn isn't indicating a given async kind that has a correlation id (or maybe thats not even needed) that it would indicate a fire/forget scenario. What do you think? If you can join the next meeting we can discuss on that call that would be great. |
|
Do we even need
But I also have a more general question/concern. I'm not clear about tooling support requirements. Provided AsyncAPI spec supports so many different protocols (websockets, kafka, mqtt, grpc, sns, sqs, etc, etc) would tooling be expected to support all of those? Or some subset? Or what? My concern is we may have almost no support from tooling as I don't even understand how "receive" can be implemented for some of those protocols. |
chore: fixes dark theme rendering
ci: adds a dependabot configuration to maintain workflow and test projects up to date
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](peter-evans/create-pull-request@v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1 to 2. - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](actions/create-github-app-token@v1...v2) --- updated-dependencies: - dependency-name: actions/create-github-app-token dependency-version: '2' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
ci: adds a code owners configuration so reviewers get automatically notified
…/json-schema-1.17.1 chore(deps-dev): bump @hyperjump/json-schema from 1.14.1 to 1.17.1
Bumps [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) from 0.18.1 to 0.19.0. - [Changelog](https://github.com/DavidAnson/markdownlint-cli2/blob/main/CHANGELOG.md) - [Commits](DavidAnson/markdownlint-cli2@v0.18.1...v0.19.0) --- updated-dependencies: - dependency-name: markdownlint-cli2 dependency-version: 0.19.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…int-cli2-0.19.0 chore(deps-dev): bump markdownlint-cli2 from 0.18.1 to 0.19.0
Bumps the vitest group with 1 update: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Updates `vitest` from 3.1.4 to 4.0.9 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.9/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-version: 4.0.9 dependency-type: direct:development update-type: version-update:semver-major dependency-group: vitest ... Signed-off-by: dependabot[bot] <[email protected]>
…edbe90d8 chore(deps-dev): bump vitest from 3.1.4 to 4.0.9 in the vitest group
The proposal for
It's not set in stone at this point and as you mention the
Arazzo itself is agnostic to the specific protocols that can be modelled within AsyncAPI. Tooling implementations may choose to support a subset of protocols depending on use case or runtime environment. We can look to state a documented set of "Recommended" protocols for tooling advertising Arazzo AsyncAPI support. Off the top of my head (not final), something like:
To help perhaps tease out some of the further details, I've created a repo with some examples. Would be great for others to chime in and/or review/enrich the examples. See https://github.com/frankkilcommins/arazzo-examples for details. |
Bumps the vitest group with 1 update: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Updates `vitest` from 4.0.9 to 4.0.10 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.10/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-version: 4.0.10 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: vitest ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 1.17.1 to 1.17.2. - [Commits](hyperjump-io/json-schema@v1.17.1...v1.17.2) --- updated-dependencies: - dependency-name: "@hyperjump/json-schema" dependency-version: 1.17.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…e05a7be7 chore(deps-dev): bump vitest from 4.0.9 to 4.0.10 in the vitest group
…/json-schema-1.17.2 chore(deps-dev): bump @hyperjump/json-schema from 1.17.1 to 1.17.2
|
@frankkilcommins — +1 on |
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps the vitest group with 1 update: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Updates `vitest` from 4.0.10 to 4.0.12 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.12/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-version: 4.0.12 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: vitest ... Signed-off-by: dependabot[bot] <[email protected]>
I disagree. This requires more validation in fact and makes it worse. See example below. It just adds unnecessary duplication and also inconsistency:
Docs generators can display it nicely.
This makes sense in general but then those steps won't be linked to any source descriptions so let's consider it later when those extensibility is introduced
@mikeschinkel, any pros/cons you have in mind? |
|
@RomanHotsiy — My +1 came from being on the bi-weekly Arazzo call with @frankkilcommins and @kevinduffey where we discussed this and @frankkilcommins explained the rationale which I remember seemed logical and useful and where the three of us agreed, though I do not remember the specifics. I will let @frankkilcommins elaborate again, and/or maybe @kevinduffey can chime in. If you are available Wednesday Nov 26th 7pm EET you could join the next call if you like. |
…/checkout-6 chore(deps): bump actions/checkout from 5 to 6
…ff92db41 chore(deps-dev): bump vitest from 4.0.10 to 4.0.12 in the vitest group
Bumps the vitest group with 1 update: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Updates `vitest` from 4.0.12 to 4.0.13 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.13/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-version: 4.0.13 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: vitest ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [respec](https://github.com/speced/respec) from 35.6.0 to 35.6.1. - [Release notes](https://github.com/speced/respec/releases) - [Changelog](https://github.com/speced/respec/blob/main/CHANGELOG.md) - [Commits](speced/respec@v35.6.0...v35.6.1) --- updated-dependencies: - dependency-name: respec dependency-version: 35.6.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
|
@frankkilcommins @kevinduffey @mikeschinkel I've gone through the updates suggested by @frankkilcommins and it all makes sense to me. Good to go from my point of view. Once we agree on this, I can update the PR and also show a working demo of this spec with Specmatic in a couple of days. |
|
Thanks @nashjain Regarding To help evaluation, i've created another branch of the examples, which does not have the https://github.com/frankkilcommins/arazzo-examples/tree/without-kind/v1.1.0-prep/async-api-examples cc @RomanHotsiy |
|
I'm OK to drop
(I prefer calling it |
ci: adds an auto-merge workflow for dependenabot minor and patch pull request
…dbeb1996 chore(deps-dev): bump vitest from 4.0.12 to 4.0.13 in the vitest group
….6.1 chore(deps): bump respec from 35.6.0 to 35.6.1
# Conflicts: # .github/workflows/respec.yaml # .github/workflows/schema-publish.yaml # .github/workflows/validate-markdown.yaml # package-lock.json # package.json # scripts/schema-publish.sh # scripts/schema-test-coverage.sh # src/schemas/validation/README.md # tests/schema/fail/invalid-arazzo-version.yaml # tests/schema/fail/not-an-object.yaml # tests/schema/pass/bnpl-example.yaml # tests/schema/pass/oauth-example.yaml # tests/schema/pass/pet-coupons-example.yaml # tests/schema/schema.test.mjs
…or asyncapi set. This is used to distinguish the asyncapi step. Replaced fork/join with dependsOn for better workflow management
|
@frankkilcommins @kevinduffey @ndenny - as per our meeting on Nov 26th, I've updated the schema. Main changes:
|
While we've tried to incorporate as much as possible from #270 not everything is covered.